﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package com.tremormedia.acudeo.adunit {
    import flash.utils.*;
    import com.tremormedia.acudeo.ad.enums.*;
    import com.tremormedia.acudeo.adunit.enums.*;

    public class CuePoint {

        protected var _value:Number;
        private var _cuePointType:CuePointType;
        protected var _position:AdPosition;

        private static var _cuePoints:Dictionary = new Dictionary(true);

        public function CuePoint(_arg1:Object){
            _position = AdPosition.valueOf(_arg1.position.toString());
            _cuePointType = CuePointType.valueOf(_arg1.type.toString());
            _value = _arg1.value;
        }
        public function get value():Number{
            return (_value);
        }
        public function getTimecode(_arg1:Number):Number{
            if (_cuePointType === CuePointType.TIME_CODE){
                return (_value);
            };
            if (_cuePointType === CuePointType.PERCENTAGE){
                return (((_arg1 * _value) / 100));
            };
            return (NaN);
        }
        public function get position():AdPosition{
            return (_position);
        }
        public function get type():CuePointType{
            return (_cuePointType);
        }

        public static function getCuePoint(_arg1:Object):CuePoint{
            if (_cuePoints[_arg1] == null){
                _cuePoints[_arg1] = new CuePoint(_arg1);
            };
            return (_cuePoints[_arg1]);
        }

    }
}//package com.tremormedia.acudeo.adunit 
